package com.appwoo.txtws.scroll;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.HomeBean;
import com.appwoo.txtws.bean.HomePageBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Global;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.service.MsgService;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class HomePageService
{
  public HomeBean getHomeBeanInfo(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    HomeBean localHomeBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>RQHomePage</TYPE>" + "</HEAD><BODY><UserID>" + paramString2 + "</UserID></BODY></MSG>";
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Logger.d("xjf", "HomePage-msg:" + str1);
    Logger.d("xjf", "HomePage-str:" + str2);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localHomeBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localHomeBean = new HomeBean();
      continue;
      if (localHomeBean != null)
        if (((XmlPullParser)localObject).getName().equalsIgnoreCase("BootTime"))
        {
          localHomeBean.setBootTime(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("CloseTime"))
        {
          localHomeBean.setCloseTime(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Flow"))
        {
          localHomeBean.setFlow(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UsedTime"))
        {
          localHomeBean.setUsedTime(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UsingUrl"))
        {
          localHomeBean.setUsingUrl(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UsingGame"))
        {
          localHomeBean.setUsingGame(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("BadUrls"))
        {
          localHomeBean.setBadUrls(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("LimitUrls"))
        {
          localHomeBean.setLimitUrls(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("LimitGames"))
        {
          localHomeBean.setLimitGames(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("IsOnline"))
        {
          localHomeBean.setIsOnline(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("NetworkStatus"))
        {
          String str4 = ((XmlPullParser)localObject).nextText();
          Logger.e("bod", "net-->" + str4);
          localHomeBean.setNetworkStatus(str4);
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("ScreenStatus"))
        {
          String str3 = ((XmlPullParser)localObject).nextText();
          Logger.e("bod", "screen-->" + str3);
          localHomeBean.setScreenStatus(str3);
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Unlimited"))
        {
          localHomeBean.setUnlimited(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UrlTime"))
        {
          localHomeBean.setUrlTime(((XmlPullParser)localObject).nextText());
        }
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("GameTime"))
        {
          localHomeBean.setGameTime(((XmlPullParser)localObject).nextText());
        }
    }
  }

  public HomePageBean getHomePageInfo(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    HomePageBean localHomePageBean = null;
    String str = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQHomePage</TYPE></HEAD><BODY><UserID>" + paramString1 + "</UserID></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localHomePageBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localHomePageBean = new HomePageBean();
      continue;
      if (localHomePageBean != null)
        if (((XmlPullParser)localObject).getName().equalsIgnoreCase("BootTime"))
          localHomePageBean.setBootTime(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Flow"))
          localHomePageBean.setFlow(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Rank"))
          localHomePageBean.setRank(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Info"))
          localHomePageBean.setInfo(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Service"))
          localHomePageBean.setService(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("PicPath"))
          localHomePageBean.setPicPath(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("PicMiddle"))
          localHomePageBean.setPicMiddle(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("PicThumb"))
          localHomePageBean.setPicThumb(((XmlPullParser)localObject).nextText());
        else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("IsOnline"))
          localHomePageBean.setIsOnline(((XmlPullParser)localObject).nextText());
    }
  }

  public String quickSubmit(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String str1 = "";
    String str2 = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>ADCmd</TYPE>" + "</HEAD><BODY><BID>" + paramString2 + "</BID><STTM>" + Global.getDateAndTime(paramContext) + "</STTM><Type>" + paramString3 + "</Type></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return str1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 0:
      case 1:
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        str1 = ((XmlPullParser)localObject).nextText();
    }
  }

  public String quickSubmitFromP(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String str1 = "";
    String str2 = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>ADCmd</TYPE>" + "</HEAD><BODY><BID>" + paramString2 + "</BID><STTM>" + Global.getDateAndTime(paramContext) + "</STTM><Type>" + paramString3 + "</Type><Remark>P</Remark></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return str1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 0:
      case 1:
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        str1 = ((XmlPullParser)localObject).nextText();
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.scroll.HomePageService
 * JD-Core Version:    0.6.2
 */